a = int(input())
if a <= 4:
    print(a)
    print(a)
    exit(0)
cnt, ans, p = 0, 1, 2
l = []
while cnt + p <= a:
    l.append(p)
    cnt += p
    p += 1
for i in range(len(l) - 1, -1, -1):
    if cnt + 1 <= a:
        cnt += 1
        l[i] += 1
    else:
        break
if cnt < a:
    l[-1] += a - cnt

for i in l:
    ans *= i
    print(i, end=' ')
print()
print(ans)